home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / BBS / KGB_105C.ARJ / KGB.DOC < prev    next >
Text File  |  1992-06-08  |  21KB  |  453 lines

  1. /*************************************************************/
  2. /* K G B 1.05Γ Foul Language Remover for Hudson Base Systems */
  3. /* Written by Alex Brodsky and Vulkan Technologies Inc.      */
  4. /* Copyright (c) 1992. All rights reserved.                  */
  5. /*************************************************************/
  6.  
  7. Table of Contents
  8.  
  9.      Legal Stuff....................................Page 2
  10.      Purpose and General Overview...................Page 3
  11.      Operations.....................................Page 4
  12.      Command Line Parameters........................Page 5
  13.           Message Base Path.........................Page 5
  14.      Configuration File Parameters..................Page 5
  15.           Location..................................Page 5
  16.           Area Selectors............................Page 6
  17.           Breakers..................................Page 6
  18.           Bad Words.................................Page 7
  19.      Examples.......................................Page 8
  20.      Error Messages.................................Page 9
  21.      Bug Reports....................................Page 9 
  22.      Contacting the Author, Famous Last Words.......Page 10
  23. 1.0 Legal Stuff                                            PAGE 2
  24.      -----------
  25.      This program is freeware. You have the right to use this
  26.      software as much as you want on as many machines as you want,
  27.      whenever you want.  You may distribute this software freely in
  28.      its original form.  You may modify your personal copy of KGB
  29.      and release it to public use under the following conditions: 
  30.  
  31.      1.   You must send the author the complete source of all the
  32.           modifications you have made.
  33.      2.   You must retain the original copyright notice and add
  34.           your own.
  35.      3.   You must clearly specify in your documentation the
  36.           date(s) and type(s) of the modification(s) you have made
  37.           to the program.
  38.      4.   You must include a copy of this license with your
  39.           release.
  40.      5.   You MUST release it as freeware.  You may NOT release   
  41.           it into the shareware or commercial market.  
  42.  
  43.      This program comes with no warranty of any kind.  It has been
  44.      tested on several machines and seems to work with no problems.
  45.      However, the author is not responsible for any damage caused
  46.      by this software. 
  47.  
  48.      You may not charge more than three Canadian dollars for
  49.      transferal or copying services.  This program may be included
  50.      in any non-commercial package as long as the three dollar rule
  51.      is not violated. 
  52.  
  53.      Commercial users may use this program in their organization's
  54.      internal operations, but may not release this software as part
  55.      of their commercial packages.  If a commercial organization
  56.      wishes to sell this software as part of their package they
  57.      must contact the author and purchase a license to do so. 
  58.  
  59.      Any other software or companies mentioned in this document are
  60.      trademarks of those respective companies and are used only to
  61.      facilitate the explanation of this software. 
  62.  
  63.      This concludes the legal part of this documentation. 
  64.  
  65.      For a donation of ten dollars or more, you will receive the
  66.      source code to this program. 
  67.  
  68.      If you do use this program, I would really appreciate you
  69.      sending me a quick netmail message saying so.  Just to let me
  70.      know that my efforts have not gone to total waste. <grin>
  71.  
  72. 2.0 Purpose and General Overview                           PAGE 3
  73.      ----------------------------
  74. 2.1  General Assumptions
  75.      This document assumes that the user is familiar with the
  76.      software and basic principles of Hudson Message Base
  77.      operation.  The user should have a basic knowledge of batch
  78.      files and should be well versed in DOS.  It is assumed that
  79.      the user runs a bbs which uses the Hudson Message Base format.
  80.  
  81. 2.2  System Requirements
  82.      The requirements for this software are a Hudson Message and
  83.      approximately 100K of memory.  A configuration file for KGB
  84.      must be present in the same directory that it is run or a full
  85.      path he file must be entered as a command line parameter.  For
  86.      a discussion of the configuration file see page 5 of the
  87.      documentation.  DOS 2.0 is the minimum requirement however DOS
  88.      3.3+ is recommended.
  89.  
  90. 2.2  What is KGB?
  91.      KGB is a foul language remover for Hudson Style message bases. 
  92.      KGB looks for "bad words" which are listed in its
  93.      configuration file and over writes them with a series of
  94.      asterisks (*).  Thus eliminating the word from the message and
  95.      hopefully not drastically changing the content of said
  96.      message.  
  97.  
  98. 2.3  General Operation
  99.      KGB first looks for the configuration file, BADWORDS.CFG. 
  100.      After finding it, KGB loads the BADWORDS.CFG file.   Once KGB
  101.      loads the configuration file, it determines from the
  102.      configuration file the location of the Hudson Message Base
  103.      (HMB), which areas to scan, which breakers to use, and which
  104.      words to scan for.  For a further discussion of this see page
  105.      5.  It then proceeds to look for a marker which it leaves in
  106.      HMB after every scan, to determine from which point to start
  107.      scanning.  This makes KGB as efficient as possible.  If it
  108.      cannot find its marker, it will start from the beginning of
  109.      the HMB and scan all of it.  Once it has determined from which
  110.      point to start scanning, it starts the memory intensive task
  111.      of loading each message, scanning it for any of the black
  112.      listed words and writing the masks back to disk once it has
  113.      done so.  Having finished all the scanning, KGB will then
  114.      write a marker message so that it can determine from where to
  115.      start scanning again the next day, and then proceeds to
  116.      display the time it took for the entire operation.  If at any
  117.      time an error occurs, KGB will exit with an error level of 1,
  118.      otherwise it will exit with an error level of 0.  This is the
  119.      general operations of KGB.
  120.  
  121. 3.0 Operations                         PAGE 4
  122.      ----------
  123. 3.1  Operating Procedures
  124.      It is recommended that KGB is run once a night along with the
  125.      other maintenance tasks which are preformed during the BBS's
  126.      maintenance event.  Just add KGB to the batch file which
  127.      performs all the maintenance tasks. 
  128.  
  129. 3.2  Description of Operational Requirements
  130.      As mentioned before, KGB must be able to find the BADWORDS.CFG
  131.      configuration file.  There are two ways that it can do so, the
  132.      first way is to have the configuration file in the same
  133.      directory that KGB is run.  The second is for the user to
  134.      specify the path to the BADWORDS.CFG as a command line
  135.      parameter, this allows KGB to find the BADWORDS.CFG file no
  136.      matter from where its run.  For a further discussion of this
  137.      see Page 5 of this manual.
  138.  
  139.      When KGB runs, it must be able to find all five files of the
  140.      HMB, the five files that the HMB consists of, these files are
  141.      MSGTXT.BBS, MSGHDR.BBS, MSGIDX.BBS, MSGTOIDX and MSGINFO.BBS.
  142.      If it does not find these files, it will abort with an error.
  143.  
  144.      At the current time KGB only works with Hudson Message Base
  145.      systems, however in later versions it will also be able to
  146.      handle SQUISH and FTSC (*.MSG) format message bases as well.
  147.  
  148. 3.3  Recommendations     
  149.      Using a disk cache to increase the speed of KGB is recommended
  150.      and is theoretically quite safe.  Since minimal writes are
  151.      performed to the message base (unless the sysop has very
  152.      profane users), there is almost no danger to the data since
  153.      KGB is mostly a read intensive utility.
  154.  
  155.      Use as many wildcards as possible, for example, the word f*ck
  156.      is found in several words like f*cker, motherf*cker, f*cking,
  157.      etc.  Use the word f*ck with wild cards instead of having KGB
  158.      check for each of the above listed words, have it just check
  159.      for f*ck with all its extenders thus saving time.  For more on
  160.      wild cards check page 7 of the manual.
  161.  
  162. 3.4  Warning
  163.      At this time KGB is not "share" friendly, if you are running
  164.      in a multi-tasking environment make sure that when KGB is run,
  165.      the files it requires are NOT being used by  another process.
  166.  
  167. 4.0 Command Line Parameters                                PAGE 5
  168.      -----------------------
  169.      KGB only takes one command parameter, this parameters is a
  170.      path to the BADWORDS.CFG configuration file.  This parameter
  171.      is only necessary if you are running KGB from a different
  172.      directory, or if the name of the configuration file is
  173.      something other then BADWORDS.CFG.  An example of this is
  174.  
  175.           KGB c:\bbs\cfg\badwords.cfg
  176.                or 
  177.           KGB c:\bbs\othernam.cfg
  178.  
  179.      This allows you to run KGB with different configuration files
  180.      and to run it from any directory and any drive.
  181.  
  182.      If this parameter is not used, KGB will look for the
  183.      BADWORDS.CFG file in the directory that it is running, if it
  184.      does not find it, it will abort with an error.
  185.  
  186. 5.0  Configuration File
  187.      ------------------
  188.      At the current time KGB takes 4 different verbs in the
  189.      configuration file, however the next version will probably
  190.      contain more.  The four verbs are: 'location', 'areas',
  191.      'breaks', and 'list start'.  At the current time it is
  192.      recommended that the first 3 verbs be used in the
  193.      configuration file before the fourth verb 'list start'  The
  194.      configuration file is a plain ascii file with each verb being
  195.      on its own line, and followed by a CRLF pair, lower or upper
  196.      case is of no consequence.  Commenting the configuration file
  197.      can be done by using the ; followed by the comment, a ; must
  198.      precede a comment on every line.  For an example of a
  199.      configuration file take a look at the Examples section of this
  200.      manual.  All four verbs must be used in the configuration file
  201.      and forgetting to put one will result in an abnormal
  202.      termination of KGB.  The descriptions of the verbs is as
  203.      follows:
  204.  
  205. 5.1  Location
  206.      The 'location' verb tells KGB the directory in which to find
  207.      the five files MSGHDR.BBS, MSGTXT.BBS, MSGIDX.BBS MSGTOIDX.BBS
  208.      and MSGINFO.BBS.  During the execution of KGB, it will display
  209.      the path which is listed in the configuration file.  The syntax
  210.      for this verb is:
  211.  
  212.       location d:\path\to\directory
  213.  
  214.           e.g.: 
  215.           location c:\bbs\msgbase
  216.  
  217.      The five files would be located in the directory msgbase,
  218.      putting a '\' after msgbase is unnecessary but will not affect
  219.      the run-time operation of KGB.
  220.  
  221. 5.0 Configuration File Continued                           PAGE 6
  222.      ----------------------------
  223. 5.2  Areas
  224.      The 'areas' verb tells KGB which areas of the HMB to scan. 
  225.      There are two different things that KGB gets from this verb
  226.      and there are several ways of doing it.  The two things the
  227.      KGB learns from this verb are which areas to scan and in which
  228.      area to place the marker message.  This is indicated by a
  229.      string of numbers separated by commas and/or the 'all'
  230.      qualifier.  The first number after the verb is the area number
  231.      in which KGB will place the message marker.  The numbers that
  232.      follow either include or exclude the areas to be scanned
  233.      depending on the 'all' qualifier.  The all qualifier tells KGB
  234.      whether to include or exclude message areas to scan.  If the
  235.      'all' qualifier is used, then KGB will scan ALL the message
  236.      bases except the ones following the 'all' qualifier.  If the
  237.      'all' qualifier is not used then KGB will scan all the numbers
  238.      listed.  The area number in which to place the marker must
  239.      come before the 'all' qualifier.  if there is no number before
  240.      the all qualifier, then KGB will place the marker in area 1. 
  241.      The syntax for this verb is as follows.
  242.  
  243.      areas (numbers delineated by commas.)
  244.  
  245.      e.g.
  246.      areas 2,all,24,26
  247.  
  248.      this tells KGB to place its marker in board 2, and scan all
  249.      message bases except 24 and 26.  See the examples section for
  250.      further examples of this Verb.
  251.  
  252. 5.3  Breakers
  253.      The 'breakers' verb tells KGB which breakers to use when
  254.      scanning.  Breakers are characters which delineate text.  The
  255.      most common breaker is the <space> others are periods,
  256.      asterisks, and commas.  KGB takes a user defined list of
  257.      breakers which it adds to the beginning and end of each word
  258.      for which it scans in the text.  The space must be included
  259.      between 2 other breakers because it would otherwise get
  260.      truncated by KGB.  A ; may not be used as a breaker since it
  261.      also denotes a comment in the configuration file.  The syntax
  262.      for this verb is:
  263.  
  264.      breakers (breakers to be used)
  265.  
  266.      e.g.
  267.      breakers !@#$%^&*()_+-= |{}[]":'/,<>
  268.  
  269. 5.0 Configuration File Continued                           PAGE 7
  270.      ----------------------------
  271. 5.4  List start
  272.      It is recommended that this verb be used last in the
  273.      configuration file because after it follows the list of black
  274.      listed words.  The function of this verb is to signal to KGB
  275.      that the list of unwanted words begins on the next line. 
  276.      There are no qualifiers following this verb.  
  277.  
  278.      The words following this verb are all the words that KGB scans
  279.      for there are 4 different ways that they can be scanned for,
  280.      and the four different ways all deal with wild cards.  The
  281.      normal way that the word is entered is without wild cards,
  282.      however some words are never used to compose non dirty words
  283.      like f*ck and sh*t.  These words are considered "dirty" no
  284.      matter what context they are in, hence fourth, these words can
  285.      be wild carded.  The difference between regular words and wild
  286.      card words is in the way KGB scan for them.  With regular
  287.      words, KGB attaches breakers to both front and back of the
  288.      word, with wild card no breaker is attached to either and/or
  289.      both ends of the word.  Thus without breakers the word can be
  290.      found in a lot more contexts then with breakers.  The wildcard
  291.      is represented by an asterisk (*).  Finally only single words
  292.      are allowed, two words on same line will get truncated to 1. 
  293.      The syntax therefore is:
  294.      
  295.      list start
  296.      (list of bad words)
  297.  
  298.      e.g.
  299.      list start
  300.      badword1
  301.      badword2*
  302.      *badword3
  303.      *badword4*
  304.  
  305.      As you can see from the example the first word will have
  306.      breakers attached to it when it is scanned, the second word
  307.      will only have breakers attached before it, in word 3 the
  308.      breakers will only be attached afterwards and in word 4 no
  309.      breakers will be used.  Using wild cards to scan is a lot
  310.      faster then with breakers, however with words like 'ass' which
  311.      makes up words like 'assume' and 'association' breakers are
  312.      necessary.  See the examples section of this manual for more
  313.      clarity.
  314.  
  315. 6.0 Examples                                               PAGE 8
  316.      --------
  317. 6.1  Command parameters for KGB:
  318.  
  319.      KGB c:\bbs\badwords.cfg
  320.  
  321.      KGB will look in c:\bbs for the configuration file called
  322.      BADWORDS.CFG
  323.      
  324.      KGB
  325.  
  326.      KGB will look in the current directory for the file
  327.      BADWORDS.CFG
  328.  
  329.      KGB d:\bbs\cfg\xxx.cfg
  330.  
  331.      KGB will look for the configuration file named XXX.CFG in the
  332.      d:\bbs\cfg directory.
  333.  
  334. 6.2  Configuration File example
  335.  
  336.      ;This is a configuration file for KGB
  337.  
  338.      ;The Message base is to be found in the c:\bbs\msgbase
  339.      ;directory
  340.  
  341.      location c:\bbs\msgbase
  342.  
  343.      ;KGB will scan ALL the areas except 200, 24, 26 and 13.  It
  344.      ;will place the marker message in area 7.
  345.  
  346.      areas 7,all,26,24,200,13
  347.  
  348.      ;The breakers used in the scanning process will be...
  349.      ;use of the semicolon ';' is not allowed
  350.  
  351.      breakers !@#$%^ &*()_+-=\|{}][:"'/?><
  352.  
  353.      ;The bad words will now be listed, some will use wildcards
  354.  
  355.      list start
  356.      badword1       ;no wild card use
  357.      badword2*      ;wild card at end of word, no end breaker used
  358.      *badword3      ;wild card at start, no start breaker used
  359.      *badword4*     ;wild card used at both ends no breakers used!
  360.      
  361.      This a typical configuration file, except that the badword?
  362.      are replaced by actual "dirty" words which I am trying to
  363.      avoid while writing these docs.
  364.  
  365. 7.0 Error Messages Glossary                    PAGE 9
  366.      -----------------------
  367. 7.1  Memory allocation Error:  This error is fatal, that is KGB
  368.      will immediately terminate its operations.  This is usually
  369.      caused by insufficient memory to run KGB which requires about
  370.      100k of memory.  To correct this problem simply flush some of
  371.      your TSRs from memory to allow KGB more memory.
  372.  
  373. 7.2  File Open Error:  If KGB does not find the files it requires
  374.      it will abort.  The solution to this problem is to make sure
  375.      that all required file are available.  Make sure that all the
  376.      paths in BADWORDS.CFG and command line parameters are correct. 
  377.      Finally, this version of KGB is NOT share friendly, and
  378.      therefore running it in a "share" environment will cause it to
  379.      terminate if it accesses a file, which has been already
  380.      accessed.
  381.  
  382. 7.3  File Read Error:  If KGB encounters a problems during the
  383.      reading of a file, e.g. a bad disk sector, it will return a
  384.      read error, just like in the case of the File Open Error, KGB
  385.      will either exit with a fatal termination error.
  386.  
  387. 7.4  File Seek Error:  Same as File Read Error except the error
  388.      occurred on a file seek action instead of a file read action,
  389.      same criteria apply.
  390.  
  391. 7.5  File Write Error: Same as File Read Error except the error
  392.      occurred on a file write action instead of a file read action,
  393.      same criteria apply.
  394.  
  395. 8.0  Bug reports, 
  396.  
  397.      If you find any bugs, please report them to me as soon as
  398.      possible.  I have done my best to ensure that KGB is as bug-
  399.      free as possible.  However no program is perfect, so if you do
  400.      find any bugs please let me know. 
  401.  
  402.      If you are getting an abnormal termination (which you
  403.      shouldn't), and you don't know why, send me a netmail with the
  404.      termination code and I'll try to help you.
  405.  
  406. 9.0 Contacting the Author And Famous Last Words            PAGE 10
  407.      -------------------------------------------
  408. 9.1  Contacting me
  409.  
  410.      You may contact me at the following BBSes.
  411.      DPSHQ     (416) 374 6188  (1:247/205) Front End Mailer only
  412.                (416) 374 3215  BBS only
  413.      DOB       (416) 937 1907  (1:247/101) 
  414.  
  415.      You may send me netmail at 1:247/191
  416.  
  417.      You may also write to me at:
  418.      38 Elma St. #11,
  419.      St. Catharines, ON,
  420.      Canada, L2N 6Z3.
  421.  
  422. 9.2  Author's Note
  423.      I have written KGB at the request of a friend who needed a
  424.      foul language remover for his BBS.  I hope that it does not
  425.      get abused and that most sysops will exempt the private area
  426.      from KGB's scan.  An appropriate tone must be maintained in
  427.      the public echoes, but in private conversation people should
  428.      be allowed to express themselves without having their
  429.      conversation censored.
  430.  
  431.      Although KGB is only capable of working on Hudson Base
  432.      messages it will in the future release be capable of working
  433.      on SQUISH and FTSC (*.MSG) message bases as well will be more
  434.      configurable.
  435.  
  436. 9.3  Famous Last Words
  437.      -----------------
  438.      I would like to thank Paul Doerwald (1:247/201) for providing
  439.      me some necessary information.  I would also like to thank
  440.      Russ Pettifer (1:247/116) who originally asked me to write
  441.      this program.
  442.  
  443.      I would like to dedicate this program to the Dead Programmers'
  444.      Society (DPS), and to all programmers out there who have been
  445.      forced to write documentation.  It is however necessary to
  446.      note that as I wrote this documentation, I was able to correct
  447.      some of KGB's original design flaws making it easier to use. 
  448.      Moral:  Even if it doesn't help the user, it helped me.
  449.  
  450.      And finally:   You know when you are having a bad day when
  451.                     your LINT begins to insult you more then you
  452.                     insult the computer.
  453.